package com.dd.dc.entity.users;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.dd.dc.base.domain.DBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 角色信息表
 * </p>
 *
 * @author JueDream
 * @since 2021-03-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("D_ROLE")
@ApiModel(value="DRole对象", description="角色信息表")
public class DRole extends DBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "角色编号")
    @TableId(value = "ROLE_ID", type = IdType.AUTO)
    private Integer roleId;

    @ApiModelProperty(value = "角色名称")
    @TableField("ROLE_NAME")
    private String roleName;

    @ApiModelProperty(value = "角色备注")
    @TableField("ROLE_REMARK")
    private String roleRemark;

    @ApiModelProperty(value = "用户权限")
    @TableField(exist = false)
    private List<DPermission> permissions = new ArrayList<>();

    public DRole(){}

    @Builder
    public DRole(Integer roleId, String roleName, String roleRemark, List<DPermission> permissions) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.roleRemark = roleRemark;
        this.permissions = permissions;
    }
}
